#pragma once
#include <QSGTexture>
#include <private/qrhi_p.h>

struct YUVTexturePrivate;
class YUVTexture : public QSGTexture
{
public:
	YUVTexture();
	~YUVTexture();

	// QSGTexture interface
public:
	qint64		 comparisonKey() const override;
	QRhiTexture* rhiTexture() const override;
	QSize		 textureSize() const override;
	bool		 hasAlphaChannel() const override;
	bool		 hasMipmaps() const override;
	void		 commitTextureOperations(QRhi* rhi, QRhiResourceUpdateBatch* resourceUpdates) override;

public:
	void setRhiTexture(QRhiTexture* rhiTexture);
	void setData(QRhiTexture::Format f, const QSize& s, const QByteArray& data);

private:
	YUVTexturePrivate* d = nullptr;
};
